package problema019;

public class DomingosPrimerosDeMes {

	public static void main(String[] args){
		System.out.println(domingosPrimeros());
	}
	
	public static int domingosPrimeros(){
		int[] dias = {31,28,31,30,31,30,31,31,30,31,30,31};
		//dia 0 = lunes
		int año = 1901, mes = 1, dia = 1, cant = 0;
		while(año != 2001){
			while(mes != 13){
				if(año % 4 == 0 && mes == 2){
					dia += 29;
				}else{
					dia += dias[mes-1];
				}
				dia = dia % 7;
				if(dia == 6){
					cant++;
				}
				mes++;
			}
			mes = 1;
			año++;
		}
		return cant;
	}
}
